# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/openssl/Attic/openssl-0.9.8o.ebuild,v 1.7 2010/11/28 14:49:16 ssuominen dead $

EAPI=2

inherit eutils flag-o-matic toolchain-funcs

DESCRIPTION="Toolkit for SSL v2/v3 and TLS v1"
HOMEPAGE="http://www.openssl.org/"
SRC_URI="mirror://openssl/source/openssl-${PV}.tar.gz"

LICENSE="openssl"
SLOT="0"
KEYWORDS="amd64"
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}
	sys-apps/diffutils
	>=dev-lang/perl-5
	test? ( sys-devel/bc )"
PDEPEND="app-misc/ca-certificates"

# src_unpack() {
# 	unpack ${A}
# 	cd "${S}"
# 
# 	epatch "${FILESDIR}"/${PN}-0.9.7e-gentoo.patch
# 	epatch "${FILESDIR}"/${PN}-0.9.8e-bsd-sparc64.patch
# 	epatch "${FILESDIR}"/${PN}-0.9.8h-ldflags.patch #181438
# 	epatch "${FILESDIR}"/${PN}-0.9.8m-binutils.patch #289130
# 
# 	# disable fips in the build
# 	# make sure the man pages are suffixed #302165
# 	# don't bother building man pages if they're disabled
# 	sed -i \
# 		-e '/DIRS/s: fips : :g' \
# 		-e '/^MANSUFFIX/s:=.*:=ssl:' \
# 		-e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
# 		-e $(has noman FEATURES \
# 			&& echo '/^install:/s:install_docs::' \
# 			|| echo '/^MANDIR=/s:=.*:=/usr/share/man:') \
# 		Makefile{,.org} \
# 		|| die
# 	# show the actual commands in the log
# 	sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared
# 
# 	# allow openssl to be cross-compiled
# 	cp "${FILESDIR}"/gentoo.config-0.9.8 gentoo.config || die "cp cross-compile failed"
# 	chmod a+rx gentoo.config
# 
# 	append-flags -fno-strict-aliasing
# 	append-flags -Wa,--noexecstack
# 
# 	sed -i '1s,^:$,#!/usr/bin/perl,' Configure #141906
# 	sed -i '/^"debug-steve/d' Configure # 0.9.8k shipped broken
# 	./config --test-sanity || die "I AM NOT SANE"
# }

src_compile() {
	cd $WORKDIR/openssl-${PV}
	./config \
		--prefix=${D}/opt/cern/alice/${P} \
		--openssldir=${D}/opt/cern/alice/${P}/ \
		no-asm no-krb5 shared -fno-strict-aliasing -L${D}/opt/cern/alice/${P}/lib \
		|| die "Configure failed"

	emake -j1 || die "depend failed"
}


src_install() {
	cd $WORKDIR/openssl-${PV}
	make install || die
}
